{% extends 'xadmin/base.html' %} {% load i18n xadmin_tags %} {% block title %}{{ title }} | {{ site_title }}{% endblock %}
{% block bodyclass %}skin-purple-light{% endblock %}
{% block body %}
<div class="wrapper">
    <!-- Header -->
    {% block top-nav %}
    <header class="main-header">
        <a href="{% url 'xadmin:index' %}" class="logo" >{% block branding %}{% firstof site_short_title site_title %}{% endblock %}</a>
        <nav id="top-nav" class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="navbar-custom-menu">                
                <ul class="nav navbar-nav">
                    {% for item in app_group %}
                    <li class="{% if item.selected %}active{% endif %}">
                        <a href="{{ item.url }}">
                            {% if item.icon %}<i class="fa-fw {{item.icon}}"></i>{% endif %}{{ item.title }}
                        </a>
                    </li>
                    {% endfor %}
                </ul>
                <form action="{% url 'xadmin:search_view' %}" method="get" class="navbar-form navbar-left">
                    <div class="input-group search-group">
                        <input type="text" name="q" class="form-control" placeholder="{% trans 'Search' %}...">
                        <span class="input-group-btn">
                            <button type="submit" id="search-btn" class="btn btn-warning" >
                                <i class="fa fa-search"></i>
                            </button>
                        </span>
                    </div>
                </form>
                {% view_block 'top_navbar' %}
                <ul class="nav navbar-nav pull-right">
                    {% view_block 'top_navmenu' %} {% if user.is_active and user.is_staff %}
                    <li class="dropdown user user-menu">
                        <a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-expanded="true" href="#">
                            <img class="user-image" alt="用户头像" src="{%static 'xadmin/img/default_user.png' %}">
                            <strong class="hidden-xs">{% trans 'Welcome,' %}{% firstof user.first_name user.username %}</strong></a>
                        <ul id="g-account-menu" class="dropdown-menu" role="menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img src="{%static 'xadmin/img/default_user.png' %}"
                                    class="img-circle" alt="用户头像">
                                <p>
                                    {% firstof user.first_name user.username %}
                                    <small>NO.{% firstof user.id "--" %}</small>
                                </p>
                            </li>
                            <!-- Menu Body -->
                            {% comment %} <li class="user-body">
                                {% block user-menu-body %}
                                {% endblock%}
                            </li> {% endcomment %}
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="btn-group" role="group" aria-label="...">
                                    {%if admin_view.profile_url%}<a href="{{admin_view.profile_url}}" class="btn btn-default btn-flat">{% trans 'Profile' %}</a> {%endif%}
                                    <a href="{% url 'xadmin:account_password' %}" class="btn btn-default btn-flat" style="display:block;">{% trans 'Change Password' %}</a>
                                </div>
                                <div class="pull-right">
                                    <a href="{% url 'xadmin:logout' %}" class="btn btn-danger btn-flat">{% trans 'Log out' %}</a></div>
                            </li>
                        </ul>
                    </li>
                    {% endif %}
                    <li><a href="{% url 'xadmin:user_settings'%}"><i class="fa fa-gears"></i></a></li>
                </ul>
            </div>
        </nav>
    </header>
    {% endblock %}

    <!-- Left side -->
    <aside class="main-sidebar">
        <section class="sidebar">
            {% block navbar %} 
            {%block userPannel%}
            {% endblock userPannel%}
            <!-- search form -->
            <ul class="sidebar-menu tree" data-widget="tree">
                <li><a href="{% url 'xadmin:index' %}"><i class="fa fa-home text-blue" aria-hidden="true" style="font-size:24px;"></i><span>&nbsp;&nbsp;管理主页</span></a></li>
            {% if nav_menu %}
                <li class="header">{% trans 'Main Menu' %}</li>
                {% for item in nav_menu %}
                <li class="{% if item.selected %} active{% endif %}{% if item.group is not True %} treeview {% endif %}" id="{{item.app}}">
                    <a href="{{ item.url|default:'#' }}">
                        {% if item.icon %}<i class="fa-fw {{item.icon}}"></i>{% else %}<i class="fa-fw fa fa-circle-o "></i>{% endif %}
                        <span>{{ item.title }}</span>
                        {%if item.menu_label %}{{item.menu_label|safe}}{%elif item.menus %}<i class="fa fa-angle-left pull-right"></i>{%endif%}
                    </a> {% if item.menus %}
                    <ul class="treeview-menu">
                        {% for sitem in item.menus %}
                        <li {% if sitem.selected %} class="active" {% endif %}>
                            {% if sitem.url %}<a href="{{ sitem.url }}">{% endif %} {% if sitem.icon %}<i class="fa-fw {{sitem.icon}}"></i>{%else%}<i
                                    class="fa-fw fa fa-circle-o"></i>{% endif %} {{ sitem.title }} {%if sitem.menu_label %}{{sitem.menu_label|safe}}{%endif%}
                                {% if sitem.url %}</a>{% endif %}
                        </li>
                        {% endfor %}
                    </ul>
                    {%endif%}
                </li>
                {% endfor %} 
                {% view_block 'menu-nav' %}            
            {% else %}
            <li>{% trans "You don't have permission to edit anything." %}</li>
            {% endif %}
            <li class="header">关于</li>
            {% for item in ext_menu %}
            <li>
                <a href="{{ item.url|default:'#' }}" target="_blank">
                    {% if item.icon %}<i class="fa-fw {{item.icon}}"></i>{% endif %}
                    <span>{{ item.title }}</span>
                    {%if item.menu_label %}{{item.menu_label|safe}}{%elif item.menus %}<i class="fa fa-angle-left pull-right"></i>{%endif%}
                </a>
            </li>
            {% endfor %}
            </ul>
            {% endblock %} 
            {% view_block 'left_navbar' %}
        </section>
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h4>
                {% block content_title %}<i class="{% firstof icon default_icon %}" aria-hidden="true"></i> {% firstof content_title title site_title %}{% endblock %}
            </h4>
            {% block breadcrumbs %}
            <ol class="breadcrumb">
                {% if breadcrumbs %} {% for bc in breadcrumbs %}
                <li>
                    {% if forloop.last or not bc.url %}{{bc.title}}{% else %}<a href="{{bc.url}}">{{bc.title}}</a>{% endif %}
                </li>
                {% endfor %} {% else %}
                <li><a href="{% url 'xadmin:index' %}"><i class="fa fa-home" aria-hidden="true"></i> {% trans 'Home' %}</a></li>
                {% if title %}{{ title }}{% endif %} {% endif %}
            </ol>
            {% endblock %}
        </section>
        <!-- Main content -->
        <section class="content">
            {% block content-nav %}
            <header>
                <nav class="navbar content-navbar navbar-default navbar-xs" role="navigation">
                    <div class="container-fluid">
                        <div class="navbar-header">
                            {% view_block 'nav_toggles' %} {% block nav_toggles %}
                            <button type="button" class="navbar-toggle" onclick="javascript: history.back();" data-toggle="offcanvas" role="button"><i
                                    class="fa fa-arrow-left"></i></button>
                            {% endblock %}
                            <a class="navbar-brand" data-toggle="collapse" data-target="#top-nav .navbar-collapse">
                                {% block nav_title %}{% if icon %}<i class="{{icon}}"></i> {% endif %}{% endblock %}
                            </a>
                        </div>
                        <div class="navbar-collapse collapse">
                            <ul class="nav navbar-nav">
                                {% view_block 'nav_menu' %}
                            </ul>
                            {% view_block 'nav_form' %} {% block nav_form %}{% endblock %}
                            <div class="navbar-btn pull-right hide-xs">
                                {% view_block 'nav_btns' %} {% block nav_btns %}{% endblock %}
                            </div>
                        </div>
                    </div>
                </nav>
            </header>
            {% endblock %} {% block messages %} {% if messages %} {% for message in messages %}
            <div class="alert alert-dismissable{% if message.tags %} {% if message.tags == 'error' %}alert-danger{% else %}alert-{{ message.tags }}{% endif %}{% endif %}">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                {{ message|safe }}
            </div>
            {% endfor %} {% endif %} {% endblock messages %} {% block content %} {{ content }} {% endblock %}
        </section>
    </div>

    {% block footer %}
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>{% trans 'Version No.' %}</b> {{m_version}}
        </div>
        <span>&copy; {{copyright}} | {% trans 'Licensed To' %}&nbsp;{{licensed_to}}</span>
    </footer>
    {% endblock %} {% block control-sidebar%} {%endblock%}
</div>
{% endblock body %}